package br.com.academix.shell
{
	import br.com.academix.shell.controller.StartupCommand;
	
	import org.puremvc.as3.multicore.interfaces.IFacade;
	import org.puremvc.as3.multicore.patterns.facade.Facade;

	public class AppFacade extends Facade implements IFacade
	{
		public function AppFacade(key:String)
		{
			super(key);
		}
		
		public static function getInstance(key:String):AppFacade{
			if(instanceMap[key] == null)
				instanceMap[key] = new AppFacade(key);
			return instanceMap[key] as AppFacade;
		}
		
		override protected function initializeController():void{
			super.initializeController();
			
			registerCommand(PureMVCSampleConstants.CMD_STARTUP, StartupCommand);
		}
		
		public function startup(app:AcademiaRIA):void{
			sendNotification(PureMVCSampleConstants.CMD_STARTUP, app);
		}
		
	}
}